import { View, Button } from '@tarojs/components'
import { useState } from 'react'
import './index.scss'

const Drawer = (props) => {
    const { content, show, onClose, top } = props

    return (
        <View className='container' onClick={(e) => {

        }}>
            <View
                onClick={() => onClose()}
                style={{ top: top }}
                className={`mask ${show ? 'show' : ''}`}

            />

            {/* 抽屉内容 */}
            <View style={show ? { top: top } : {}} className={`drawer ${show ? 'show' : ''}`}>
                <View className='content'>
                    {content}
                </View>
            </View>
        </View>
    )
}

export default Drawer